package com.tongtech.space.common.aop;

import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.annotation.AfterReturning;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

/**
 * 通知类Demo
 *
 * @author jinjiayu
 * @since 2021/01/19
 */
@Aspect
@Component
@Slf4j
public class AnnotationAspect {


    @Pointcut("@annotation(com.tongtech.space.common.aop.AnnotationDemo)")
    public void demo() {
    }

    @AfterReturning("demo() && @annotation(annotationDemo)")
    @Transactional(rollbackFor = Exception.class)
    public Object doConcurrentOperation(AnnotationDemo annotationDemo) {
        // Todo 编写具体的业务实现

        return null;
    }

}
